package com.reader.cms.entity.sys;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * @author jiahaikun
 * @@description
 * @date 2018-08-06
 */
@TableName("sys_login_log")
public class SysLoginLog extends Model<SysLoginLog> {

    private static final long serialVersionUID = 1L;


    @TableId(value = "id", type = IdType.AUTO)


    private Integer id;

    /**
     * 关联sysUser
     */

    @TableField("user_id")
    private Long userId;

    /**
     * 登录ip
     */

    @TableField("login_ip")
    private String loginIp;

    /**
     * 登录时间
     */


    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @TableField("login_dt")
    private Date loginDt;

    /**
     * 公共代码：ACCESS_TYPE, android,ios,smallprogramm，,h5,web
     */

    @TableField("access_type")
    private String accessType;

    /**
     * 公共代码：DEVICE_TYPE,mobile,手机，web 网站，ipad
     */

    @TableField("device_type")
    private String deviceType;

    /**
     * 退出时间
     */


    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @TableField("logout_dt")
    private Date logoutDt;

    /**
     * 备注
     */


    private String remark;

    /**
     * 用户名
     */
    @TableField(exist = false)
    private String loginId;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }

    public Date getLoginDt() {
        return loginDt;
    }

    public void setLoginDt(Date loginDt) {
        this.loginDt = loginDt;
    }

    public String getAccessType() {
        return accessType;
    }

    public void setAccessType(String accessType) {
        this.accessType = accessType;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public Date getLogoutDt() {
        return logoutDt;
    }

    public void setLogoutDt(Date logoutDt) {
        this.logoutDt = logoutDt;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getLoginId() {
        return loginId;
    }

    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SysLoginLog{" +
                ", id=" + id +
                ", userId=" + userId +
                ", loginIp=" + loginIp +
                ", loginDt=" + loginDt +
                ", accessType=" + accessType +
                ", deviceType=" + deviceType +
                ", logoutTt=" + logoutDt +
                ", remark=" + remark +
                "}";
    }
}